package com.jt.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jt.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;
public interface UserMapper extends BaseMapper<User> {  //泛型对象必须添加

    List<User> findAll();

    User findUserByUP(User user);


    @Select("SELECT COUNT(1) FROM user")
    long findCount();
    List<User> findUserLimit(@Param("query") String query,@Param("start") int start,@Param("size") int size);

    @Update("update user set status =#{status},updated =#{updated} where id =#{id}")
    void updateStatus(User user);

    @Delete("delete from user where id =#{id}")
    void deleteUserById(Integer id);

    void addUser();

    @Select("select * from user where id=#{id}")
    User findUserById(Integer id);
    @Update("update user set phone=#{phone},email=#{email},updated=#{updated} " +
            "where id=#{id}")
    void updateUser(User user);
}
